<%-- 
    Document   : edit
    Created on : Aug 4, 2013, 4:35:56 PM
    Author     : Thien Nguyen
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<head>
    <link href="css/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="css/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
</head>
<jsp:include page="header3.jsp"/>
<c:if test="${type eq 'comment'}">
    <c:forEach var="item" items="${LIST}">
        <h1>Thay đổi nội dung bình luận</h1><br/>
        <form action="ControllerServlet" class="form-horizontal">
            Nội dung bình luận: <textarea name="content" class="form-control" rows="3">${item.content}</textarea>  <br/>
            <input type="hidden" name="id" value="${item.commentID}" />
            <input type="hidden" name="type" value="comment" />
            <div class="form-group">
                <div class="col-lg-offset-2 col-lg-10">
                    <button type="submit" value="Save" name="btnAction" class="btn btn-default">Lưu</button>
                </div>
            </div>
            <div class="form-group">
                <div class="col-lg-offset-2 col-lg-10">
                    <button type="submit" value="Back" name="btnAction" class="btn btn-default">Trở về trang chính</button>
                </div>
            </div>
        </form>
    </c:forEach>
</c:if>
<c:if test="${type eq 'album'}">
    <c:forEach var="item" items="${LIST}">
        <h1>Thay đổi thông tin album</h1><br/>
        <form action="ControllerServlet" class="form-horizontal">
            ID: ${item.albumID} <br/>
            Tên album: ${item.albumName} <br/>
            <div class="form-group">
                <label for="casi" class="col-lg-2 control-label">Url hình ảnh</label>
                <div class="col-lg-10">
                    <input type="text" class="form-control" id="casi" name="url" value="${item.imageUrl}">
                </div>
            </div>
            <div class="form-group">
                <div class="col-lg-offset-2 col-lg-10">
                    <button type="submit" value="Save" name="btnAction" class="btn btn-default">Lưu</button>
                </div>
            </div>
            <div class="form-group">
                <div class="col-lg-offset-2 col-lg-10">
                    <button type="submit" value="Back" name="btnAction" class="btn btn-default">Trở về trang chính</button>
                </div>
            </div>
            <input type="hidden" name="type" value="album" />
        </form>
    </c:forEach>
</c:if>
<c:if test="${type eq 'song'}">
    <c:forEach var="song" items="${LIST}">
        <form action="ControllerServlet" class="form-horizontal">
        <h1>Thay đổi thông tin bài hát</h1><br/>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Tên bài hát</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="name" value="${item.name}">
            </div>
        </div>
        Ca sĩ:
        <select name="artist" class="form-control">
            <c:forEach items="${artist}" var="item">
                <option value="${item.artistID}">${item.artistName}</option>
            </c:forEach>
        </select> <br/>
        Album:
        <select name="album" class="form-control">
            <c:forEach items="${album}" var="item">
                <option value="${item.albumID}">${item.albumName}</option>
            </c:forEach>
        </select> <br/>
        Thể loại:
        <select name="genre" class="form-control">
            <c:forEach items="${genre}" var="item">
                <option value="${item.genreID}">${item.genreName}</option>
            </c:forEach>
        </select> <br/>
        Nhà sản xuất:
        <select name="producer" class="form-control">
            <c:forEach items="${producer}" var="item">
                <option value="${item.producerID}">${item.producerName}</option>
            </c:forEach>
        </select> <br/>
        Quốc gia:
        <select name="country" class="form-control">
            <c:forEach items="${country}" var="item">
                <option value="${item.countryID}">${item.countryName}</option>
            </c:forEach>
        </select> <br/>
        Nhạc sĩ:
        <select name="musician" class="form-control">
            <c:forEach items="${musician}" var="item">
                <option value="${item.musicianID}">${item.musicianName}</option>
            </c:forEach>
        </select> <br/>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Năm sản xuất</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="year" value="${item.publishYear}">
            </div>
        </div>
        Bài hát: <label class="checkbox-inline">
            <input type="checkbox" id="inlineCheckbox1" name="isSong" value="true"> Có
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="inlineCheckbox2" name="isSong" value="false"> Không
        </label>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Thứ tự trong album</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="no" value="${item.no}">
            </div>
        </div>
        Lời bài hát: <textarea name="lyric" class="form-control" rows="4" >${item.lyrics}</textarea><br/>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Link nghe/xem 1</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="l1" value="${item.l1}">
            </div>
        </div>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Link nghe/xem 2</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="l2" value="${item.l2}">
            </div>
        </div>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Link nghe/xem 3</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="l3" value="${item.l3}">
            </div>
        </div>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Link nghe/xem 4</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="l4" value="${item.l4}">
            </div>
        </div>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Link download 1</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="d1" value="${item.d1}">
            </div>
        </div>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Link download 2</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="d2" value="${item.d2}">
            </div>
        </div>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Link download 3</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="d3" value="${item.d3}">
            </div>
        </div>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Link download 4</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="d4" value="${item.d4}">
            </div>
        </div>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Thumbnail</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="thumbnail" value="${item.thumbnail}">
            </div>
        </div>
        <input type="hidden" name="type" value="song" />
        <div class="form-group">
            <div class="col-lg-offset-2 col-lg-10">
                <button type="submit" value="Save" name="btnAction" class="btn btn-default">Lưu</button>
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-offset-2 col-lg-10">
                <button type="submit" value="Back" name="btnAction" class="btn btn-default">Trở về trang chính</button>
            </div>
        </div>
    </form>
    </c:forEach>
</c:if>
<c:if test="${type eq 'user'}">
    <c:forEach var="item" items="${LIST}">
        <form action="ControllerServlet" class="form-horizontal">
        <h1>Thay đổi thông tin người dùng</h1><br/>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Người dùng</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" id="casi" name="username" value="${item.username}">
            </div>
        </div>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Mật khẩu</label>
            <div class="col-lg-10">
                <input type="password" class="form-control" id="casi" name="password" value="${item.password}">
            </div>
        </div>
        <div class="form-group">
            <label for="casi" class="col-lg-2 control-label">Email</label>
            <div class="col-lg-10">
                <input type="password" class="form-control" id="casi" name="email" value="${item.email}">
            </div>
        </div>
        Vai trò: <label class="checkbox-inline">
            <input type="checkbox" id="inlineCheckbox1" name="role" value="true"> Admin
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="inlineCheckbox2" name="role" value="false"> Người dùng
        </label>
        <div class="form-group">
            <div class="col-lg-offset-2 col-lg-10">
                <button type="submit" value="Save" name="btnAction" class="btn btn-default">Lưu</button>
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-offset-2 col-lg-10">
                <button type="submit" value="Back" name="btnAction" class="btn btn-default">Trở về trang chính</button>
            </div>
        </div>
        <input type="hidden" name="id" value="${item.username}" />
        <input type="hidden" name="type" value="user" />
    </form>
    </c:forEach>
</c:if>
<jsp:include page="footer.jsp"/>
